package com.xdog.web3.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.xdog.web3.domain.transactionhistory.TransactionDetailByTxHashRequest;
import com.xdog.web3.domain.transactionhistory.TransactionsByAddressRequest;
import com.xdog.web3.service.ITransactionHistoryService;
import com.xdog.web3.utils.Web3ApiUtil;
import org.springframework.stereotype.Service;

@Service
public class TransactionHistoryServiceImpl implements ITransactionHistoryService {

    @Override
    public JSONObject getTransactionsByAddress(TransactionsByAddressRequest request) {
        String requestPath = "/api/v6/dex/post-transaction/transactions-by-address";
        return Web3ApiUtil.get(requestPath, request);
    }

    @Override
    public JSONObject getTransactionDetailByTxHash(TransactionDetailByTxHashRequest request) {
        String requestPath = "/api/v6/dex/post-transaction/transaction-detail-by-txhash";
        return Web3ApiUtil.get(requestPath, request);
    }
}
